<%@taglib prefix="in" uri="/WEB-INF/TagDescriptor.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Map Roles</title>
<in:pHeader />
<script type="text/javascript" src="includes/js/jquery/global.js"></script>
<script type="text/javascript" src="includes/js/mapRole.js">
</script>
</head>
<body>
	<div class="formBody" style="width: 100%; font-size: 11px">
		<table>
		<tr>
<!-- 				<td>Show All</td> -->
				<td colspan="2">
					 <select id="showAll" class="easyui-combobox" name="showAll" style="width:200px;" data-options="
							onSelect: function(rec){
							var urlAll = 'loadUsers.htm?showAll=YES';
							var urlExisting='loadUsers.htm?showAll=NO';
							var url='';
							if(rec.value=='YES')
								url=urlAll;
							else
								url=urlExisting;
							$('#targetUser').combobox('reload', url);
							}">
							<option value="NO">Existing Users</option>
							<option value="YES">All Users</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="2"><span style="color: #8F5700; font-size: 14px"></span><b/>Map User Roles</td>
			</tr>
			<tr>
<!-- 		 	    <td>Select User: </td> -->
 				<td colspan="2"><input class="easyui-combobox" data-options="valueField:'id',textField:'text',url:'loadUsers.htm?showAll=NO',required:true" style="width: 200px;" id="targetUser"/></td> 
			</tr>
			
			<tr>
				<td colspan="2"><span style="color: #8F5700; font-size: 14px"></span><b/>Assign Permissions</td>
			</tr>
		</table>
		
		<table class="easyui-datagrid" id="userRole" style="width: 200px; height: 200px;" fitColumns="true">
			<thead>
				<tr>
					<th field="name" width="180">Priviledge</th> 
					<th field="description" width="180">Description</th> 
					<th field="permitted" width="20" checkbox="true">true</th>
				</tr>
			</thead>
		</table>		
		<a id="reloadList" onclick="reloadList()"	class="easyui-linkbutton" >Reload</a>
		<a id="saveList" onclick="saveList()"	class="easyui-linkbutton">Save</a>
	</div>
</body>
</html>
